package com.wnxy.consumer.c_direct;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class LogConsumer {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "queue-direct-log",durable = "true"),
            exchange = @Exchange(name = "exchange-log",type = ExchangeTypes.DIRECT),
            key = {"info","error","warning"}
    ))
    public void handlerMsg(String msg) {
        System.out.println("日志信息：" + msg);
    }
}
